package item.action;

import java.util.StringTokenizer;

import item.model.ItemInfo;
import item.dao.ItemDAO;

import com.opensymphony.xwork2.Action;
import com.opensymphony.xwork2.ActionContext;
import com.opensymphony.xwork2.Preparable;
import com.opensymphony.xwork2.ModelDriven;

public class ViewAction implements Action,Preparable,ModelDriven {
	
	ItemInfo itemInfo;
	ItemDAO itemDAO = ItemDAO.getInstance();
	//private StringTokenizer st;
	
	public String execute() throws Exception {
		itemInfo = itemDAO.selectOne(itemInfo.getItemno());
		//st = new StringTokenizer(itemInfo.getColor(),",");
		
		return SUCCESS;
	}
	
	
	/*public StringTokenizer getSt() {
		return st;
	}
	public void setSt(StringTokenizer st) {
		this.st = st;
	}*/

	public ItemInfo getItemInfo() {
		return itemInfo;
	}

	public void prepare() throws Exception {
		itemInfo = new ItemInfo();
	}	
	public Object getModel() {
		return itemInfo;
	}
}
